﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PowerSwitch : InteractiveItems
{
    [SerializeField] PowerSupply powerSupply;
    [SerializeField] protected bool isActive = false;
    private void Start()
    {
        if (isActive)
        {
            powerSupply.Open();
        }
        else
        {
            powerSupply.Close();
        }
    }

    public override void Interactive()
    {
        base.Interactive();
        isActive = !isActive;
        if (isActive)
        {
            powerSupply.Open();
        }
        else
        {
            powerSupply.Close();
        }
    }
}
